package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.constant.NetConstant;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.ISplashModel;
import com.rjwh.dingdong.client.network.HttpWebService;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 王小珂
 * @ClassName SplashModel
 * @Description
 * @date 2017-1-13
 * @history 2017-1-13 author: description:
 */

public class SplashModel extends BaseModel implements ISplashModel, HttpWebServiceCallBack {

    public SplashModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 启动更新数据
     */
    @Override
    public void doAppStartUp() {
        Map<String, String> params = new HashMap<>();
        HttpWebService.getDataFromServer(NetConstant.APPSTARTUP, params, true, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if(getBasePresenter()!=null){
            getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
        }
    }
}
